/**
 * @param {string} s
 * @param {number} k
 * @return {number}
 */
var maxVowels = function (s, k) {
    const vowels = ['a', 'e', 'i', 'o', 'u'];
    let maxCount = 0;
    let count = 0;
    for (let i = 0; i < k; i++) {
        if (vowels.includes(s[i])) {
            count++;
        }
    }
    maxCount = count;
    for (let i = k; i < s.length; i++) {
        if (vowels.includes(s[i])) {
            count++;
        }
        if (vowels.includes(s[i - k])) {
            count--;
        }
        maxCount = Math.max(maxCount, count);
    }
    return maxCount;
};
console.log(maxVowels("abciiidef", 3));
